/*
 * XML Type:  InvestmentBalance
 * Namespace: http://ofx.net/types/2003/04
 * Java type: net.ofx.types.x2003.x04.InvestmentBalance
 *
 * Automatically generated - do not modify.
 */
package net.ofx.types.x2003.x04.impl;
/**
 * An XML InvestmentBalance(@http://ofx.net/types/2003/04).
 *
 * This is a complex type.
 */
public class InvestmentBalanceImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements net.ofx.types.x2003.x04.InvestmentBalance
{
    
    public InvestmentBalanceImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName AVAILCASH$0 = 
        new javax.xml.namespace.QName("", "AVAILCASH");
    private static final javax.xml.namespace.QName MARGINBALANCE$2 = 
        new javax.xml.namespace.QName("", "MARGINBALANCE");
    private static final javax.xml.namespace.QName SHORTBALANCE$4 = 
        new javax.xml.namespace.QName("", "SHORTBALANCE");
    private static final javax.xml.namespace.QName BUYPOWER$6 = 
        new javax.xml.namespace.QName("", "BUYPOWER");
    private static final javax.xml.namespace.QName BALLIST$8 = 
        new javax.xml.namespace.QName("", "BALLIST");
    
    
    /**
     * Gets the "AVAILCASH" element
     */
    public java.lang.String getAVAILCASH()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(AVAILCASH$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "AVAILCASH" element
     */
    public net.ofx.types.x2003.x04.AmountType xgetAVAILCASH()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(AVAILCASH$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "AVAILCASH" element
     */
    public void setAVAILCASH(java.lang.String availcash)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(AVAILCASH$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(AVAILCASH$0);
            }
            target.setStringValue(availcash);
        }
    }
    
    /**
     * Sets (as xml) the "AVAILCASH" element
     */
    public void xsetAVAILCASH(net.ofx.types.x2003.x04.AmountType availcash)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(AVAILCASH$0, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.AmountType)get_store().add_element_user(AVAILCASH$0);
            }
            target.set(availcash);
        }
    }
    
    /**
     * Gets the "MARGINBALANCE" element
     */
    public java.lang.String getMARGINBALANCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MARGINBALANCE$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "MARGINBALANCE" element
     */
    public net.ofx.types.x2003.x04.AmountType xgetMARGINBALANCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(MARGINBALANCE$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "MARGINBALANCE" element
     */
    public void setMARGINBALANCE(java.lang.String marginbalance)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MARGINBALANCE$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(MARGINBALANCE$2);
            }
            target.setStringValue(marginbalance);
        }
    }
    
    /**
     * Sets (as xml) the "MARGINBALANCE" element
     */
    public void xsetMARGINBALANCE(net.ofx.types.x2003.x04.AmountType marginbalance)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(MARGINBALANCE$2, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.AmountType)get_store().add_element_user(MARGINBALANCE$2);
            }
            target.set(marginbalance);
        }
    }
    
    /**
     * Gets the "SHORTBALANCE" element
     */
    public java.lang.String getSHORTBALANCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SHORTBALANCE$4, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "SHORTBALANCE" element
     */
    public net.ofx.types.x2003.x04.AmountType xgetSHORTBALANCE()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(SHORTBALANCE$4, 0);
            return target;
        }
    }
    
    /**
     * Sets the "SHORTBALANCE" element
     */
    public void setSHORTBALANCE(java.lang.String shortbalance)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SHORTBALANCE$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(SHORTBALANCE$4);
            }
            target.setStringValue(shortbalance);
        }
    }
    
    /**
     * Sets (as xml) the "SHORTBALANCE" element
     */
    public void xsetSHORTBALANCE(net.ofx.types.x2003.x04.AmountType shortbalance)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(SHORTBALANCE$4, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.AmountType)get_store().add_element_user(SHORTBALANCE$4);
            }
            target.set(shortbalance);
        }
    }
    
    /**
     * Gets the "BUYPOWER" element
     */
    public java.lang.String getBUYPOWER()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(BUYPOWER$6, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "BUYPOWER" element
     */
    public net.ofx.types.x2003.x04.AmountType xgetBUYPOWER()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(BUYPOWER$6, 0);
            return target;
        }
    }
    
    /**
     * True if has "BUYPOWER" element
     */
    public boolean isSetBUYPOWER()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(BUYPOWER$6) != 0;
        }
    }
    
    /**
     * Sets the "BUYPOWER" element
     */
    public void setBUYPOWER(java.lang.String buypower)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(BUYPOWER$6, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(BUYPOWER$6);
            }
            target.setStringValue(buypower);
        }
    }
    
    /**
     * Sets (as xml) the "BUYPOWER" element
     */
    public void xsetBUYPOWER(net.ofx.types.x2003.x04.AmountType buypower)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.AmountType target = null;
            target = (net.ofx.types.x2003.x04.AmountType)get_store().find_element_user(BUYPOWER$6, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.AmountType)get_store().add_element_user(BUYPOWER$6);
            }
            target.set(buypower);
        }
    }
    
    /**
     * Unsets the "BUYPOWER" element
     */
    public void unsetBUYPOWER()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(BUYPOWER$6, 0);
        }
    }
    
    /**
     * Gets the "BALLIST" element
     */
    public net.ofx.types.x2003.x04.BalanceList getBALLIST()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BalanceList target = null;
            target = (net.ofx.types.x2003.x04.BalanceList)get_store().find_element_user(BALLIST$8, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "BALLIST" element
     */
    public boolean isSetBALLIST()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(BALLIST$8) != 0;
        }
    }
    
    /**
     * Sets the "BALLIST" element
     */
    public void setBALLIST(net.ofx.types.x2003.x04.BalanceList ballist)
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BalanceList target = null;
            target = (net.ofx.types.x2003.x04.BalanceList)get_store().find_element_user(BALLIST$8, 0);
            if (target == null)
            {
                target = (net.ofx.types.x2003.x04.BalanceList)get_store().add_element_user(BALLIST$8);
            }
            target.set(ballist);
        }
    }
    
    /**
     * Appends and returns a new empty "BALLIST" element
     */
    public net.ofx.types.x2003.x04.BalanceList addNewBALLIST()
    {
        synchronized (monitor())
        {
            check_orphaned();
            net.ofx.types.x2003.x04.BalanceList target = null;
            target = (net.ofx.types.x2003.x04.BalanceList)get_store().add_element_user(BALLIST$8);
            return target;
        }
    }
    
    /**
     * Unsets the "BALLIST" element
     */
    public void unsetBALLIST()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(BALLIST$8, 0);
        }
    }
}
